﻿Imports System.Data.SqlClient
Public Class Provinces
    Public Shared Function getProvince() As SortedList
        Dim cmd As New SqlCommand("SELECT * FROM  [PROVINCE]", Dbinterface.Connection)

        Dim reader As SqlDataReader = cmd.ExecuteReader
        Dim list As New SortedList
        While reader.Read
            Dim province As New ProvinceInfo
            With province
                .ProvinceId = reader("PROVINCE_ID").ToString
                .ProvinceName = reader("PROVINCE_NAME").ToString
                .Active = reader("ACTIVE").ToString
                list.Add(province.ProvinceId, province)

            End With
        End While
        reader.Close()
        reader = Nothing
        cmd = Nothing
        Return list
    End Function
End Class
